function create_image(img_name, x, y){
	// create container div element
	var div = insert_html_element("card", "div", null, null);
	var div_id = div.attr("id");
	
	// create img tag and add to tree
	var img = insert_html_element(div_id, "img", {
		src: "/uploads/images/" + img_name,
		resize: false
	}, null);
	//var img_id = img.attr("id");
	
	div.addClass("image-element").attr("type", "image");
	
	// set position of the div
	cardPx = $("#card").offset().left;
	cardPy = $("#card").offset().top;
	div.css("left", x-cardPx+"px").css("top", y-cardPy+"px").css("z-index", zIndexMax);
	
	// make the div resizable and draggable
	/*
	div.draggable({
		start: function(event, ui) {
			ui.helper.data("dragging", true);	// prevent from click handler firing
        },
        stop: function(event, ui) {
            setTimeout(function(){ui.helper.data("dragging", false);}, 300);
        }
	});
	div.resizable();
	div.rotatable();
	*/
}

function create_text(x, y){
	var div = insert_html_element("card", "div", {Text: "New Text"}, null);
	//var div_id = div.attr("id");
	
	div.addClass("text-element").attr("type", "text");
	
	// set div position
	cardPx = $("#card").offset().left;
	cardPy = $("#card").offset().top;
	div.css("left", x-cardPx+"px").css("top", y-cardPy+"px").css("z-index", zIndexMax);
	
	// make the div resizable and draggable
	/*
	div.draggable({
		start: function(event, ui) {
			ui.helper.data("dragging", true);	// prevent from click handler firing
        },
        stop: function(event, ui) {
            setTimeout(function(){ui.helper.data("dragging", false);}, 300);
        }
	});
	div.resizable();
	div.rotatable();
	*/
}